package com.itheima.homework;

public class work3 {
    public static void main(String[] args) {
        int fish = 24;
        int fishdiscount = 16;
        int peanuts = 8;
        int rice = 3;
        double amount1 = (fish + peanuts + rice);
        amount1 = amount1 > 30 ? amount1 * 0.8 : amount1;
        double amount2 = (fishdiscount + peanuts + rice);
        double amount = amount1 < amount2 ? amount1 : amount2;
        System.out.println(amount);

    }
}
